<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml"
	xmlns:tailor="http://www.tailor.org.br/seam">

	<ui:define name="body">
		<div id="page-wrap" >
		<tailor:form id="consulta">
			<h1>
				Consulta <span>Corretor</span>
			</h1>
			<div class="name_wrap2" align="center" style=" margin: 14px 22px; width:955px;" >
				<rich:panel id="pesquisa" style="background: #f3f3f3; border:1px solid #ccc;">
						<tailor:inputText componentSize="3"  required="false" name="nomePesquisa"  value="#{corretorAction.nomeCorretor}" label="Nome:"/>
						<tailor:inputText componentSize="3"  required="false" name="nomeGuerraPesquisa"  value="#{corretorAction.nomeGuerra}" label="Nome de Guerra:"/>
						<tailor:inputText componentSize="2"  required="false" name="creciPesquisa"  value="#{corretorAction.creciCorretor}" label="Creci:"/>
						<tailor:selectOneMenu componentSize="2" required="false" label="Classificação" name="classificacaoPesquisa" items="#{classificacoes}" value="#{classificacaoSelecionada}" itemsLabel="nomeClassificacao" itemsType="entity"></tailor:selectOneMenu>
						<tailor:selectOneMenu componentSize="2" required="false" label="Título" name="tituloPesquisa" items="#{titulos}" value="#{tituloSelecionado}" itemsLabel="nomeTitulo" itemsType="entity"></tailor:selectOneMenu>
						<tailor:selectOneMenu componentSize="2" required="false" label="Situação" name="situacaoPesquisa" items="#{situacoes}" value="#{situacaoSelecionada}" itemsLabel="nomeSituacao" itemsType="entity"></tailor:selectOneMenu>
						<tailor:selectOneMenu componentSize="2" required="false" label="Status" name="statusPesquisa" items="#{listaStatus}" value="#{statusSelecionado}" itemsLabel="nomeStatus" itemsType="entity"></tailor:selectOneMenu>
						<br class="Clear"/>
						<h:commandButton reRender="consulta" value="Pesquisar" style="margin: 10px; border: 1px solid #7DB9E8 !important; border-radius: 2px; height: 25px; background: -moz-linear-gradient(top, #ebf1f6 0%, #abd3ee 50%, #89c3eb 51%, #d5ebfb 100%);" />
						<h:commandButton action="#{corretorAction.novoCorretor()}" value="Novo Corretor" style="margin: 10px; border: 1px solid #7DB9E8 !important; border-radius: 2px; height: 25px; background: -moz-linear-gradient(top, #ebf1f6 0%, #abd3ee 50%, #89c3eb 51%, #d5ebfb 100%);" />
						<h:commandButton  id="voltar" value="Voltar" action="VOLTAR" style="margin: 10px; border: 1px solid #7DB9E8 !important; border-radius: 2px; height: 25px; background: -moz-linear-gradient(top, #ebf1f6 0%, #abd3ee 50%, #89c3eb 51%, #d5ebfb 100%);"/>
				</rich:panel>
			</div>
			
			<div id="resultado" class="name_wrap2" align="center" style=" margin: 14px 22px; width: 955px" >
				<rich:panel style="background: #f3f3f3; border:1px solid #ccc;">
					<tailor:dataTable  noResultMessage="Nenhum registro encontrado." name="listaCor" value="#{corretorAction.listaCorretores()}" var="corretorDados" rows="20" >
						<tailor:column label="Creci" value="#{corretorDados.corretorCreci}"/>
						<tailor:column label="Nome" value="#{corretorDados.pessoa.nomePessoa}" clientOrder="true" />
						<tailor:column style="width:150px;" label="Classificação" value="#{corretorDados.classificacao.nomeClassificacao}" />
						<tailor:column style="width:100px;" label="Título" value="#{corretorDados.titulo.nomeTitulo}"/>
						<tailor:column style="width: 100px" label="Situação" value="#{corretorDados.situacao.nomeSituacao}"></tailor:column>
						<rich:column  style="width:50px;" filterValue="#{corretorPessoa.statusCorretor}">
							<f:facet name="header">
								<h:outputText value="Status" />
							</f:facet>
							<s:div style="float:center; text-align:center;">
									<img  src="#{corretorDados.getImgSituacao(corretorDados.statusCorretor.nomeStatus)}" title="#{corretorDados.statusCorretor.nomeStatus}" />
							</s:div>
						</rich:column>	
						<rich:column style="width:50px;">
							<f:facet name="header">
								<h:outputText value="Editar" />
							</f:facet>
							<s:div style="float:center; text-align:center;">
								<h:commandLink action="#{corretorAction.editarCorretor(corretorDados.corretorCreci)}" title="Editar">
									<img src="../../../../img/edit.png" alt="Editar" title="Editar"/>
								</h:commandLink>
							</s:div>
						</rich:column>
					</tailor:dataTable>					
				</rich:panel>
				</div>
		</tailor:form>
		</div>
	</ui:define>
</ui:composition>